function tr2obj(tr){
    var tdList = tr.cells;
    var tdKeyList = new Array();
    var tdValList = new Array();
    
    for (var i = 0; i < tdList.length; i++) {
        var elem = tdList[i];
        if(elem.getAttribute("form-data")){
            tdKeyList[i] = elem.getAttribute("form-data");
            tdValList[i] = elem.innerText;
        }
    }
    
    var myJSON = createJSON(tdKeyList, tdValList);
    var myObj = JSON.parse(myJSON);
    return myObj;
}

function createJSON(keyList, valList){
    var key_value_list = new Array();
    for (var i = 0; i < keyList.length; i++) {
        var keyElem = keyList[i];
        var valElem = valList[i];
        key_value_list[i] = "\"" + keyElem + "\" : \"" + valElem + "\"";
    }
    
    var myJSON = "{ " + key_value_list.join(", ") + " }";
    return myJSON;
}